package cn.com.dhcc.app.pub.core.job.filedata;

import org.apache.log4j.Logger;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean.StatefulMethodInvokingJob;

import cn.com.dhcc.app.core.CM;
import cn.com.dhcc.app.core.service.Log;
import cn.com.dhcc.app.core.service.Log.LOGTYPE;
import cn.com.dhcc.app.pub.core.consts.AppConst;
import cn.com.dhcc.turbo.service.exch.filedata.FileDataExchageLifecycle;

/**
 * 
 * 定时任务 定时清理FTP_HOME目录的文件
 * 默认清理七天以前的的文件
 * @日期 2015-8-17 下午3:08:51
 * @作者  高强
 */
public class FtpHomeCleanUpCronJob extends StatefulMethodInvokingJob {
	private Logger logger = Log.getLogger(LOGTYPE.QUARTZJOB);
	
	@Override
	protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
		System.out.println("*******************************定时任务FtpHomeCleanUpCronJob执行开始*****************");
		logger.info("["+AppConst.installIp+"]"+"定时任务FileDataParseRemoteRespCronJob开始执行....");
		 FileDataExchageLifecycle service = (FileDataExchageLifecycle) CM.getBeanByName("fileDataExchageLifecycle");
		 service.cleanUpFtpHome();
		logger.info("["+AppConst.installIp+"]"+"定时任务FileDataParseRemoteRespCronJob执行结束....");
		System.out.println("*******************************定时任务FtpHomeCleanUpCronJob执行结束*****************");
	}
}
